package com.org.enums;
/**
 *
 * @Title: ConditionType
 * @Description: 状态 - 房态
 * @author zhangxurui
 * @date 2018年4月23日 下午5:14:35
 */
public enum ConditionType {

    KONGZHI("空置", 1),
    ZHUANGXIU("装修", 2),
    BAOLI("保理", 3),
    FENQI("分期", 4),
    SHOUFEI("收费", 5),
    QIANFEI("欠费", 6),
    KUAIDAO("快到", 7),
    DAOQI("到期", 8),
    YIDENGJI("已登记", 9);


    private String name;
    private int index;

    private ConditionType(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (ConditionType c : ConditionType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (ConditionType c : ConditionType.values()) {
            if (c.getName().equals(name)) {
                return c.getIndex();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
